
export const TOKEN_DATA = "token_data"
export const TOKEN_PRE = "token_pre"

export const USER_INFO = "user_info"

export const LANGUAGE = "language"


export const storage = {
    //存储
    set(key, value) {
        localStorage.setItem(key, value)
    },
    //取出
    get(key) {
        const value = localStorage.getItem(key)
        return value
    },
    remove(key){
        localStorage.removeItem(key)
    }
}

// 拼接后的token
export const getToken=()=>{
    return storage.get(TOKEN_PRE)+" "+storage.get(TOKEN_DATA)
}

export const removeToken = ()=>{
    storage.remove(TOKEN_PRE)
    storage.remove(TOKEN_DATA)
}
